function _(e:any):any {
  return document.querySelector(e)
}
_('#btnAdd').onclick=function () {
  let strKey:string=_('#key').value
  let strValue:string=_('#value').value
  localStorage.setItem(strKey,strValue)
  alert('保存成功~~!')
}
_('#btnGet').onclick=function () {
  let strKey:string=_('#key').value
  let strValue= localStorage.getItem(strKey)
  alert('取出的数据是:' + strValue)
}
_('#btnRemove').onclick=function () {
  let strKey:string=_('#key').value
  localStorage.removeItem(strKey)
  alert('您删除的数据是:'+strKey)
}
_('#btnClear').onclick=function () {
  localStorage.clear()
}
_('#btnAddObj').onclick=function () {
  let strKey:string=_('#key').value
  let objValue:object=_('#value').value
  localStorage.setItem(strKey,JSON.stringify(objValue))
  alert('保存成功啦')
}
_('#btnGetObj').onclick=function () {
  let strKey:string=_('#key').value
  let objValue=localStorage.getItem(strKey)
  alert('取数据成功啦:'+ objValue)
  console.log(JSON.parse(objValue as string));
  
}